﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ExampleMvcApplication.Models.Customer>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript"></script>
    <script src="../../Scripts/Elvalweb-0.0.1.js" type="text/javascript"></script>
      
    <% Html.EnableClientValidation(); %>

    <h2>Index</h2>

    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
               Id - required field, so you must enter value.
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Id) %>
                <%= Html.ValidationMessageFor(model => model.Id) %>
            </div>
            
            <div class="editor-label">
               First Name required with lngth validation from 2 to 10.
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FirstName) %>
                <%= Html.ValidationMessageFor(model => model.FirstName) %>
            </div>
            
            <div class="editor-label">
                 Last Name - enter enything you want
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.LastName) %>
                <%= Html.ValidationMessageFor(model => model.LastName) %>
            </div>

            <div class="editor-label">
                Password contain numbers and special chars. AndComposite validator example +  ConatainsCharecters
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Password) %>
                <%= Html.ValidationMessageFor(model => model.Password)%>
            </div>
            
            <div class="editor-label">
               Email - standart regex. Not required.
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.EMail) %>
                <%= Html.ValidationMessageFor(model => model.EMail) %>
            </div>
            
            <div class="editor-label">
                Choose the number from 10 to 100 inclusive :)
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FavoriteNumber) %>
                <%= Html.ValidationMessageFor(model => model.FavoriteNumber) %>
            </div>
            
            <div class="editor-label">
                Float number range. >1.3 and <=2.1, so 1.3000001 is ok
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FavoriteFloatNumber) %>
                <%= Html.ValidationMessageFor(model => model.FavoriteFloatNumber) %>
            </div>
            
            <div class="editor-label">
                What is your favorite letter? From b to d inclusive :)
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.FavoriteLetter) %>
                <%= Html.ValidationMessageFor(model => model.FavoriteLetter) %>
            </div>
            
            <div class="editor-label">
                This is the demonstration of the OrCompositeValidator. This fild will accept \d{1,2} value
                for age, or \d{1,2}/\d{1,2}/\d{4} for date of birth. Cool thing I think.
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.YearOfBirthOrHowManyYears) %>
                <%= Html.ValidationMessageFor(model => model.YearOfBirthOrHowManyYears) %>
            </div>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

  

</asp:Content>

